//
//  LKBoTongFeedbackFeatureWebViewController.m
//  iOS-BTong-ApplicationCenter
//
//  Created by maqz on 2018/4/10.
//  Copyright © 2018年 毛毛驴. All rights reserved.
//

#import "LKBoTongFeedbackFeatureWebViewController.h"

#import "LKBoTongFeedbackWebViewController+Navigation.h"
#import "LKBoTongFeedbackWebViewController+Landscape.h"
#import "LKBoTongFeedbackWebViewController+UserInfo.h"
#import "LKBoTongFeedbackWebViewController+Camera.h"
#import "LKBoTongFeedbackWebViewController+PictureBrowser.h"
@interface LKBoTongFeedbackFeatureWebViewController ()

@end

@implementation LKBoTongFeedbackFeatureWebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self addScriptMessageHandlerWithName:BotongApplicationCenterNavigationJSHandler];
    [self addScriptMessageHandlerWithName:BotongApplicationCenterLandscapeJSHandler];
    [self addScriptMessageHandlerWithName:BotongApplicationCenterUserInfoJSHandler];
    [self addScriptMessageHandlerWithName:BotongApplicationCenterCameraJSHandler];
    [self addScriptMessageHandlerWithName:BotongApplicationCenterPictureBrowserJSHandler];

    [self loadWebViewWithURL:_webURL];
}

- (void)scriptMessage:(WKScriptMessage *)message {
    
    [self scriptNavitationMessage:message];
    [self scriptLandscapeMessage:message];
    [self scriptUserInfoMessage:message];
    [self scriptCameraMessage:message];
    [self scriptPictureBrowserMessage:message];

}

- (void)setUserInfoDic:(NSDictionary *)userInfoDic{
    if (userInfoDic) {
        [[NSUserDefaults standardUserDefaults] setObject:userInfoDic forKey:@"LKBOTONGFEEDBACK_USERDEFAULTS_USERINFO"];
    }
    
}

- (NSString *)webURL {
    if (!_webURL) {
        _webURL = @"https://h5.botong.tech/#/customerService";
    }
    return _webURL;
}


@end
